from pms.common.views import PostFormula
from project.models import ProjectPermission


class API(PostFormula):

    def handle(self, req):
        _ = req['pid']
        permissions = ProjectPermission.objects.all()
        return self.success_respond({
            'list': [
                {
                    'id': p.id,
                    'name': p.name,
                    'detail': p.detail
                } for p in permissions
            ]
        })
